<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * 商铺成员
 */

class Suser_mdl extends CI_Model {

    const TABLE = 'suser';

    public function select(){
        return $this->db->get(self::TABLE)->result_array();
    }

    public function get_one(){
        return $this->db->get(self::TABLE)->row_array();
    }

    //统计
    public function get_count(){
        return $this->db->count_all_results(self::TABLE);
    }

    //添加
    public function create($data){
        $data['end_time'] = $data['create_time'] = time();
        return $this->db->insert(self::TABLE,$data);
    }
    //修改
    public function update($data){
        return $this->db->update(self::TABLE,$data);
    }
    //删除
    public function delete(){
        $data = ['status' => 2];
        return $this->update($data);
    }
}

/* End of file suser_mdl.php */
/* Location: ./application/models/suser_mdl.php */